import LineMd from "@renderer/components/icons/config/lineMd";
import Meteocons from "@renderer/components/icons/config/meteocons";
import Normal from "@renderer/components/icons/config/normal";
import { static_images } from "@renderer/components/Images/config";
const generateImages = (list: any) => {
  return list.map((item, index) => {
    return {
      name: "图片" + (index + 1),
      value: "myImgs",
      canReq: false,
      imgname: item,
    };
  });
};
const generateList = (icons) => {
  let keys = Object.keys(icons);
  let list = [];
  for (let i = 0; i < keys.length; i++) {
    list.push({
      name: keys[i],
      value: "myIcons",
      iconName: keys[i],
      canReq: false,
      ifIcon: true,
    });
  }
  return list;
};

type ChildType = {
  id?: number | string;
  name: string;
  value: string;
  canReq?: boolean; // 是否可请求数据
  ifIcon?: boolean;
  iconName?: string;
};
type List = {
  id: string | number;
  name: string;
  icon?: string;
  children?: ChildType[];
};
const firstList: List[] = [
  {
    id: "charts",
    name: "图表",
    icon: "menu_charts",
  },
  {
    id: "info",
    name: "信息",
    icon: "menu_info",
  },
  {
    id: "comp",
    name: "组件",
    icon: "menu_comp",
  },
  {
    id: "picture",
    name: "图片",
    icon: "menu_pic",
  },
  {
    id: "icons",
    name: "图标",
    icon: "menu_icon",
  },
];
// 图表
const charts_List: List[] = [
  {
    id: 1,
    name: "柱状图",
    children: [
      {
        name: "基础柱状图",
        value: "barCharts",
        canReq: true,
      },
      {
        name: "堆积柱状图",
        value: "barStackCharts",
        canReq: true,
      },
      {
        name: "堆叠条形图",
        value: "barCategoryStackCharts",
        canReq: true,
      },
      {
        name: "多数值轴轴缩放图",
        value: "barZoomCharts",
        canReq: true,
      },
    ],
  },
  {
    id: 2,
    name: "折线图",
    children: [
      {
        name: "基础折线图",
        value: "lineCharts",
        canReq: true,
      },

      {
        name: "折柱混合图",
        value: "lineBarCharts",
        canReq: true,
      },
      {
        name: "堆叠折线图",
        value: "lineStackCharts",
        canReq: true,
      },
      {
        name: "堆叠面积图",
        value: "lineStackAreaCharts",
        canReq: true,
      },
      {
        name: "区域缩放折线图",
        value: "lineWithZoomChart",
        canReq: true,
      },
    ],
  },
  {
    id: 3,
    name: "饼图",
    children: [
      {
        name: "圆角环形图",
        value: "paiRoundCharts",
        canReq: true,
      },
      {
        name: "半环形图",
        value: "paiHalfCharts",
        canReq: true,
      },
      {
        name: "玫瑰图",
        value: "roseChart",
        canReq: true,
      },
    ],
  },
  {
    id: 4,
    name: "更多",
    children: [
      {
        name: "仪表盘",
        value: "gaugeChart",
        canReq: true,
      },
      {
        name: "雷达图",
        value: "radar",
        canReq: true,
      },
    ],
  },
];
// 信息
const info_List: List[] = [
  {
    id: "info1",
    name: "文本",
    children: [
      {
        name: "文字",
        value: "textWord",
        canReq: false,
      },
      {
        name: "滚动文字",
        value: "wordScroll",
        canReq: false,
      },
      {
        name: "Link链接",
        value: "links",
        canReq: false,
      },
    ],
  },
  {
    id: "info2",
    name: "控件",
    children: [
      {
        // id: "info2_1",
        name: "按钮",
        value: "mybutton",
        canReq: false,
      },
      {
        // id: "info2_1",
        name: "单选框",
        canReq: true,
        value: "myRadios",
      },
      {
        // id: "info2_1",
        name: "多选框",
        canReq: true,
        value: "myCheckBox",
      },
      {
        // id: "info2_1",
        name: "Switch开关",
        value: "mySwitch",
        canReq: false,
      },
      {
        // id: "info2_1",
        name: "下拉框",
        value: "myselect",
        canReq: true,
      },
      {
        name: "日期选择框",
        value: "myDate",
        canReq: false,
      },
      {
        name: "时间选择框",
        value: "myTimer",
        canReq: false,
      },
      {
        name: "输入框",
        value: "myInput",
        canReq: false,
      },
      {
        name: "表格",
        value: "myTable",
        canReq: true,
      },
      {
        name: "滚动列表",
        value: "scrollDiv",
        canReq: true,
      },
      {
        name: "分页",
        canReq: true,
        value: "pagination",
      },
    ],
  },
  {
    id: "info3",
    name: "轮播",
    children: [
      {
        name: "走马灯",
        value: "carousel",
        canReq: false,
      },
    ],
  },
];
// 组件
const comp_List: List[] = [
  {
    id: "comp1",
    name: "边框",
    children: [
      {
        name: "边框1",
        value: "myBorder1",

        canReq: false,
      },
      {
        name: "边框2",
        value: "myBorder2",
        canReq: false,
      },
      {
        name: "边框3",
        value: "myBorder3",
        canReq: false,
      },
      {
        name: "边框4",
        value: "myBorder4",
        canReq: false,
      },
      {
        name: "边框5",
        value: "myBorder5",
        canReq: false,
      },
      {
        name: "边框6",
        value: "myBorder6",
        canReq: false,
      },
      {
        name: "文字边框1",
        value: "myTextBorder1",
        canReq: false,
      },
      {
        name: "文字边框2",
        value: "myTextBorder2",
        canReq: false,
      },
      {
        name: "文字边框3",
        value: "myTextBorder3",
        canReq: false,
      },
      {
        name: "文字边框4",
        value: "myTextBorder4",
        canReq: false,
      },
      {
        name: "文字边框5",
        value: "myTextBorder5",
        canReq: false,
      },
    ],
  },
  {
    id: "comp4",
    name: "标题",
    children: [
      {
        name: "大屏标题框1",
        value: "myTextDecoration6",
        canReq: false,
      },
      {
        name: "大屏标题框2",
        value: "myTextDecoration7",
        canReq: false,
      },
    ],
  },
  {
    id: "comp2",
    name: "装饰",
    children: [
      {
        name: "装饰1",
        value: "myDecoration1",
        canReq: false,
      },
      {
        name: "装饰2",
        value: "myDecoration2",
        canReq: false,
      },
      {
        name: "装饰3",
        value: "myDecoration3",
        canReq: false,
      },
      {
        name: "装饰4",
        value: "myDecoration4",
        canReq: false,
      },
      {
        name: "装饰5",
        value: "myDecoration5",
        canReq: false,
      },
      {
        name: "装饰6",
        value: "myDecoration6",
        canReq: false,
      },
      {
        name: "装饰7",
        value: "myDecoration7",
        canReq: false,
      },
      {
        name: "装饰8",
        value: "myDecoration8",
        canReq: false,
      },
      {
        name: "文字装饰1",
        value: "myTextDecoration1",
        canReq: false,
      },
      {
        name: "文字装饰2",
        value: "myTextDecoration2",
        canReq: false,
      },
      {
        name: "文字装饰3",
        value: "myTextDecoration3",
        canReq: false,
      },
      {
        name: "文字装饰4",
        value: "myTextDecoration4",
        canReq: false,
      },
      {
        name: "文字装饰5",
        value: "myTextDecoration5",
        canReq: false,
      },
    ],
  },
  {
    id: "comp3",
    name: "三维",
    children: [
      {
        name: "3D折线图",
        value: "lineChart3D",
        canReq: true,
      },
      {
        name: "3D柱状图",
        value: "barChart3D",
        canReq: true,
      },
      // {
      //   name: "3D饼图",
      //   value: "paiChart3D",
      //   canReq: true,
      // },
    ],
  },
];
// 图片
const picture_List: List[] = [
  {
    id: "pic1",
    name: "静态",
    children: [...generateImages(static_images)],
  },
  {
    id: "pic2",
    name: "自定义",
    children: [
      {
        name: "自定义图片",
        value: "image",
        canReq: false,
      },
    ],
  },
  // {
  //   id: "pic3",
  //   name: "其它",
  //   children: [],
  // },
];
// 图标
const icons_List: List[] = [
  {
    id: "icons1",
    name: "动画",
    children: [...generateList(LineMd)],
  },
  {
    id: "icons2",
    name: "通用",
    children: [...generateList(Normal)],
  },
  {
    id: "icons3",
    name: "天气",
    children: [...generateList(Meteocons)],
  },
];

export default {
  firstList,
  charts_List,
  info_List,
  comp_List,
  picture_List,
  icons_List,
};
